import request from '@/utils/request'

export const getExpenseDetailById = (id) =>
  request({
    url: '/test/expenseDetail/' + id,
    method: 'get'
  })

export const listExpenseDetailPage = (search) =>
  request({
    url: '/test/expenseDetail/list',
    method: 'post',
    data: search
  })

export const listExpenseDetailAll = (search) =>
  request({
    url: '/test/expenseDetail/listAll',
    method: 'post',
    data: search
  })

export const deleteExpenseDetail = (expenseDetail) =>
  request({
    url: '/test/expenseDetail/delete',
    method: 'post',
    data: expenseDetail
  })

export const getExpenseDetailByTaskId = (TaskId) =>
  request({
    url: '/test/expenseDetail/task/' + TaskId,
    method: 'get'
  })
export const createExpenseDetail = (processId, formData) =>
  request({
    url: '/test/expenseDetail/' + processId + '/create',
    method: 'post',
    data: formData
  })
export const createExpenseDetailByKey = (key, tenantId, formData) =>
  request({
    url: '/test/expenseDetail/key/' + key + (tenantId ? '/tenant-id/' + tenantId : '') + '/create',
    method: 'post',
    data: formData
  })
export const reapplyExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/reapply',
    method: 'post',
    data: formData
  })

export const agreeExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/agree',
    method: 'post',
    data: formData
  })

export const forwardExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/forward',
    method: 'post',
    data: formData
  })

export const commissionExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/commission',
    method: 'post',
    data: formData
  })

export const proposeExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/propose',
    method: 'post',
    data: formData
  })

export const backExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/back',
    method: 'post',
    data: formData
  })
export const rejectExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/reject',
    method: 'post',
    data: formData
  })

export const terminateExpenseDetail = (taskId, formData) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/terminate',
    method: 'post',
    data: formData
  })

export const reverseExpenseDetail = (taskId) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/reverse',
    method: 'post'
  })

export const listBackActivity = (taskId) =>
  request({
    url: '/test/expenseDetail/' + taskId + '/listBackActivity',
    method: 'get'
  })
